//
//  ByMineLogoutHeaderView.m
//  Homept_ios
//
//  Created by justiOS on 16/10/14.
//  Copyright © 2016年 pro. All rights reserved.
//

#import "ByMineLogoutHeaderView.h"
//#import "ByLoginVC.h"           // 登录
@implementation ByMineLogoutHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        [self _initViews];
//        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(bgTap)];
//        [self addGestureRecognizer:tap];
    }
    
    return self;
    
}

#pragma mark -- 初始化子视图
- (void)_initViews {
    [self _initBgImgView];
    [self _initIconImgView];
    [self _initLabel];
}
- (void)_initBgImgView {
    self.bgImgView = [[UIImageView alloc] initWithFrame:self.bounds];
//    self.bgImgView.image = [UIImage imageNamed:@"mine_bg"];
    self.bgImgView.image = [UIImage imageWithColor:HTB_THEME_COLOR];
    [self addSubview:self.bgImgView];
    
    UIImageView *indorView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 15, 15)];
//    indorView.image = [UIImage imageNamed:@"mine_jiantou"];
    indorView.image = [UIImage imageWithColor:[UIColor redColor]];
    [self.bgImgView addSubview:indorView];
    indorView.y = self.height / 2 + 20;
    indorView.right = self.bgImgView.width - 20;
    
}
- (void)_initIconImgView {
    self.iconImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 70, 70)];
    self.iconImgView.left = self.width / 4;
    self.iconImgView.y = self.height / 2 + 20;
    self.iconImgView.image = DEFAULT_HEAD;
//    self.iconImgView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.iconImgView];
    self.iconImgView.layer.cornerRadius = self.iconImgView.width / 2;
    self.iconImgView.layer.masksToBounds = YES;
}
- (void)_initLabel {
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(self.iconImgView.right + 20, self.height/2 - 15, self.width - 40 - (self.iconImgView.right + 20), 30)];
    self.label.font = FONT(18);
    self.label.textAlignment = NSTextAlignmentLeft;
    self.label.textColor = [UIColor whiteColor];
    self.label.text = @"请登录";
    [self addSubview:self.label];
    self.label.y = self.iconImgView.y;
}




#pragma mark -- 点击事件
//- (void)bgTap {
//    ByBaseVC *superVC = (ByBaseVC *)self.viewController;
//    if (BY_USER == nil) {
//        ByLoginVC *lgvc = [[ByLoginVC alloc] init];
//        [superVC by_normalPush:lgvc hasNavi:YES];
//    }
//}






@end
